
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2341. -- 山中的湖 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2341: 山中的湖</h2><span class=green>Time Limit: </span>20 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>2&nbsp;&nbsp;<span class=green>Solved: </span>0<br>[<a href='submitpage.php?id=2341'>Submit</a>][<a href='problemstatus.php?id=2341'>Status</a>][<a href='bbs.php?id=2341'>Discuss</a>]</center><h2>Description</h2><div class=content><p><img alt="" src="/JudgeOnline/upload/201106/111.jpg" /></p></div><h2>Input</h2><div class=content><p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">第一行两个正整数，<font face="Times New Roman">N</font><font face="宋体">表示山的折线上的拐点数（包括端点在内），</font><font face="Times New Roman">M</font><font face="宋体">则是你收到的消息数。</font><font face="Times New Roman">3&nbsp;&lt;=&nbsp;N&nbsp;&lt;=&nbsp;100000</font><font face="宋体">，</font><font face="Times New Roman">0&nbsp;&lt;=&nbsp;M&nbsp;&lt;=&nbsp;100000</font><font face="宋体">。</font></span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">后面<font face="Times New Roman">N</font><font face="宋体">行，第</font><font face="Times New Roman">i</font><font face="宋体">行有两个非负整数</font><font face="Times New Roman">Xi</font><font face="宋体">和</font><font face="Times New Roman">Yi</font><font face="宋体">，表示折线上第</font><font face="Times New Roman">i</font><font face="宋体">个拐点的坐标。</font></span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">后面<font face="Times New Roman">M</font><font face="宋体">行，每行是以下两种情况之一：</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p>
<table style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0pt; padding-top: 0pt; border-collapse: collapse; mso-table-layout-alt: fixed">
    <tbody>
        <tr>
            <td valign="top" width="92" style="border-right: rgb(0,0,0) 0.5pt solid; padding-right: 5.4pt; border-top: rgb(0,0,0) 0.5pt solid; padding-left: 5.4pt; padding-bottom: 0pt; border-left: rgb(0,0,0) 0.5pt solid; width: 69.2pt; padding-top: 0pt; border-bottom: rgb(0,0,0) 0.5pt solid; mso-border-left-alt: 0.5000pt solid rgb(0,0,0); mso-border-right-alt: 0.5000pt solid rgb(0,0,0); mso-border-top-alt: 0.5000pt solid rgb(0,0,0); mso-border-bottom-alt: 0.5000pt solid rgb(0,0,0)">
            <p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 10.5pt; font-style: italic; font-family: '宋体'; mso-spacerun: 'yes'">Survey</span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">&nbsp;x&nbsp;</span><span style="font-size: 10.5pt; font-family: '宋体'"><o:p></o:p></span></p>
            </td>
            <td valign="top" width="476" style="border-right: rgb(0,0,0) 0.5pt solid; padding-right: 5.4pt; border-top: rgb(0,0,0) 0.5pt solid; padding-left: 5.4pt; padding-bottom: 0pt; border-left: medium none; width: 357.2pt; padding-top: 0pt; border-bottom: rgb(0,0,0) 0.5pt solid; mso-border-left-alt: none; mso-border-right-alt: 0.5000pt solid rgb(0,0,0); mso-border-top-alt: 0.5000pt solid rgb(0,0,0); mso-border-bottom-alt: 0.5000pt solid rgb(0,0,0)">
            <p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 9pt; font-family: '宋体'; mso-spacerun: 'yes'">表示测量<font face="Times New Roman">x</font><font face="宋体">位置的水深和水平面的海拔高度。</font><font face="Times New Roman">x</font><font face="宋体">是一个实数，保证</font><font face="Times New Roman">X1&nbsp;&lt;=&nbsp;x&nbsp;&lt;=&nbsp;Xn</font><font face="宋体">。</font></span><span style="font-size: 9pt; font-family: '宋体'"><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="page-break-inside: TableInfo">
            <td valign="top" width="92" style="border-right: rgb(0,0,0) 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0pt; border-left: rgb(0,0,0) 0.5pt solid; width: 69.2pt; padding-top: 0pt; border-bottom: rgb(0,0,0) 0.5pt solid; mso-border-left-alt: 0.5000pt solid rgb(0,0,0); mso-border-right-alt: 0.5000pt solid rgb(0,0,0); mso-border-top-alt: 0.5000pt solid rgb(0,0,0); mso-border-bottom-alt: 0.5000pt solid rgb(0,0,0)">
            <p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 10.5pt; font-style: italic; font-family: '宋体'; mso-spacerun: 'yes'">Descend</span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">&nbsp;x&nbsp;y&nbsp;</span><span style="font-size: 10.5pt; font-family: '宋体'"><o:p></o:p></span></p>
            </td>
            <td valign="top" width="476" style="border-right: rgb(0,0,0) 0.5pt solid; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0pt; border-left: medium none; width: 357.2pt; padding-top: 0pt; border-bottom: rgb(0,0,0) 0.5pt solid; mso-border-left-alt: none; mso-border-right-alt: 0.5000pt solid rgb(0,0,0); mso-border-top-alt: 0.5000pt solid rgb(0,0,0); mso-border-bottom-alt: 0.5000pt solid rgb(0,0,0)">
            <p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 9pt; font-family: '宋体'; mso-spacerun: 'yes'">表示输入中的第<font face="Times New Roman">x</font><font face="宋体">个点的地面的海拔高度降低到了</font><font face="Times New Roman">y</font><font face="宋体">。</font></span><span style="font-size: 9pt; font-family: '宋体'"><o:p></o:p></span></p>
            </td>
        </tr>
    </tbody>
</table>
</p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">题中所有坐标（包括<font face="Times New Roman">Descend</font><font face="宋体">中的）都是</font><font face="Times New Roman">0</font><font face="宋体">到</font></span><span style="font-size: 10.5pt; font-family: 'Times New Roman'; mso-spacerun: 'yes'">1000000</span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">之间的整数。</span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<!--EndFragment--></div><h2>Output</h2><div class=content><p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">输出格式：</span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">首先输出一开始的山上的储水量。</span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">对于每个<font face="Times New Roman">Survey</font><font face="宋体">，输出一行</font><font face="Times New Roman">a&nbsp;b</font><font face="宋体">。</font><font face="Times New Roman">a</font><font face="宋体">表示该位置的水深（如果没有水则为</font><font face="Times New Roman">0</font><font face="宋体">），</font><font face="Times New Roman">b</font><font face="宋体">表示该位置的水面的海拔高度（如果没有水，则为该位置的土地的高度）。</font></span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">对于每个<font face="Times New Roman">Descend</font><font face="宋体">，输出新的储水量。</font></span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt"><span style="font-size: 10.5pt; font-family: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class="p0" style="margin-top: 0pt; margin-bottom: 0pt; text-indent: 21.3pt"><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'">输出中的所有数字保留<font face="Times New Roman">2</font><font face="宋体">位小数。</font></span><span style="font-size: 10.5pt; font-family: '宋体'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<!--EndFragment--></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>7 3<br />
0 0<br />
1 4<br />
2 2<br />
3 6<br />
4 4<br />
6 5<br />
8 0<br />
Survey 5.5<br />
Descend 3 2<br />
Survey 5.5<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>2.75<br />
0.25 5.00<br />
4.00<br />
0.00 4.75</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search='></a></p></div><center>[<a href='submitpage.php?id=2341'>Submit</a>][<a href='problemstatus.php?id=2341'>Status</a>][<a href='bbs.php?id=2341'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
